const demoList = {
	select: function(select) {
		const ind = select.selectedIndex;
		const value = select.options[ind].value;
		$("#input").val(value);
	},
	post: function(select) {
		const value = select.options[ind].value;
		var obj = {
			text: value
		};
		$("#right").val("");
		$.ajax({
			crossDomain: true,
			contentType: "application/json; charset=utf-8",
			type: "POST",
			dataType: "json",
			url: URL + "insertIncNum",
			data: JSON.stringify(obj),
			complete: function(XMLHttpRequest, status) {
				return;
			},
			success: function(data) {
				$("#times").text(data.num);
				if (data.err != "") {
					$("#right").val(data.err);
				} else {
					$("#right").val(data.text);
				}
			},
			error: function(XMLHttpResponse) {
				if (XMLHttpResponse != null)
					alert(XMLHttpResponse.responseText);
			}
		});
	}

}
